package com.anzia.storeback.controller;

import com.anzia.storeback.dao.ProductDao;
import com.anzia.storeback.entity.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *@ClassName test
 *@Description
 *@Author Anzia.
 *@Date 2021/5/29 19:39
 *@Version 1.0
 **/
@RestController
public class test {

    @Autowired
    public ProductDao productDao;

    @RequestMapping("test")
    public String dmeo() {

        List<Product> allProduct = productDao.getAllProduct();
        for (Product product : allProduct) {

            System.out.println(product);

        }

        return "hello world!";
    }
}
